<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>去除重复字母</title>
</head>
<body>
  <script>
    function fn(s) {
      let arr = []
      s.split('').filter(item => {
        // 判断数值元素是否在arr数组中，如果存在则跳过这个循环
        if (arr.includes(item)) return
        arr.push(item)
      })
      return arr.sort().join('')
    }
    console.log(fn("cbacdcbc"))
  </script>
</body>
</html>